<?php
class SeatsController extends AppController {

	var $name = 'Seats';
	var $scaffold = 'admin';
	//var $uses = array('Event','Ticket');
	
	function create_seats() {
		$ticket_id = 1;
		$event_id = 1;
		$row = "GA";
		$num_seats = 80;
		$i = 1;		
		while ($i <= $num_seats) {
			$this->Seat->create();
			$seats = array('event_id' => $event_id, 'ticket_id' => $ticket_id, 'row' => $row, 'number' => $i);
			$this->Seat->save($seats);
			$i++;
			}
		$this->set('save_array', $seats);
		}
	
/*	function find() {
		
		if (empty($this->data)) {
			$this->Session->setFlash('Unable to find tickets, please select an event.');
			$this->redirect('/events/');
			}

		$post = $this->data;
		$this->set('data', $post);
		$this->set('event', $this->Event->find($post['ticket']['event_id']));

		$conditions = array('ticket.event_id' => $post['ticket']['event_id'], 'ticket.id' => $this->data['ticket']['sections']);		
		$fields = array('ticket.name', 'ticket.price');
		$section = $this->Ticket->find('first', array('fields' => $fields, 'recursive' => 0, 'conditions' => $conditions));
		$this->set('section', $section);

		}
*/
}
?>